package com.atguigu.gmall.product.mapper;

import com.atguigu.gmall.model.product.SkuInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * sku信息处理dao
 */
@Mapper
public interface SkuInfoMapper extends BaseMapper<SkuInfo> {

    /**
     * 使用乐观锁方案
     */
    public int updateSkuStock(@Param("id")Long id,
                              @Param("num")Integer num);

    /**
     * 取消订单回滚
     */
    public int updateCancelSkuStock(@Param("id")Long id,
                              @Param("num")Integer num);
}
